<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>糖尿病风险预测</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <div class="container">
        <header>
            <h1>糖尿病风险预测系统</h1>
            <p>输入患者信息进行糖尿病风险评估</p>
        </header>

        {% if error %}
        <div class="error-message">
            <p>{{ error }}</p>
        </div>
        {% endif %}

        <form action="/predict" method="post" id="prediction-form">
            {% for feature in features %}
            <div class="form-group">
                <label for="{{ feature }}">{{ feature }}</label>
                <input type="number" id="{{ feature }}" name="{{ feature }}" step="any" required>
                <small class="hint">
                    {% if feature == 'Pregnancies' %}怀孕次数{% endif %}
                    {% if feature == 'Glucose' %}空腹血糖 (mg/dl){% endif %}
                    {% if feature == 'BloodPressure' %}舒张压 (mm Hg){% endif %}
                    {% if feature == 'SkinThickness' %}三头肌皮褶厚度 (mm){% endif %}
                    {% if feature == 'Insulin' %}2小时血清胰岛素 (mu U/ml){% endif %}
                    {% if feature == 'BMI' %}体重指数 (kg/m^2){% endif %}
                    {% if feature == 'DiabetesPedigreeFunction' %}糖尿病家族史函数{% endif %}
                    {% if feature == 'Age' %}年龄 (岁){% endif %}
                </small>
            </div>
            {% endfor %}

            <div class="form-actions">
                <button type="submit" class="btn-predict">预测风险</button>
                <button type="reset" class="btn-reset">重置</button>
            </div>
        </form>

        <footer>
            <p>© 2023 糖尿病风险预测系统 | <a href="/feature-importance">查看特征重要性</a></p>
        </footer>
    </div>
</body>
</html> 